package org.example.config;

import com.fasterxml.jackson.databind.SerializationFeature;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;

/**
 * @BelongsProject: Dynamic-relationship-binding
 * @BelongsPackage: org.example.config
 * @Author: dengxiyan
 * @CreateTime: 2025/07/04  14:54
 * @Description: TODO
 * @Version: 1.0
 */
@Configuration
public class JacksonConfig {

    @Bean
    public Jackson2ObjectMapperBuilder jacksonBuilder() {
        Jackson2ObjectMapperBuilder builder = new Jackson2ObjectMapperBuilder();
        builder.featuresToEnable(SerializationFeature.WRITE_SELF_REFERENCES_AS_NULL);
        return builder;
    }
}
